<template>
  <div>
    <header>
      <p>发票采集</p>
    </header>
    <div class="player">
      <div class="swiper-container">
        <!-- 轮播图片 -->
        <div class="swiper-wrapper">
          <div class="swiper-slide">
            <img src="../assets/images/lunbo1.png">
          </div>
          <div class="swiper-slide">
            <img src="../assets/images/lunbo1.png">
          </div>
          <div class="swiper-slide">
            <img src="../assets/images/lunbo1.png">
          </div>

        </div>
        <!-- 导航按钮 -->
        <div class="swiper-pagination"></div>
      </div>
    </div>
    <div class="box">
      <ul>
        <li onclick="saomiao()">
          <img src="../assets/images/scan.png" alt="">
          <p>扫一扫</p>
        </li>
        <router-link to="/inputInfo">
          <li>
            <img src="../assets/images/entry.png" alt="">
            <p>发票录入</p>
          </li>
        </router-link>
        <li>
          <img src="../assets/images/electronic.png" alt="">
          <p>电子发票</p>
        </li>
      </ul>
    </div>
    <footer>
      <ul>
        <li>
          <img src="../assets/images/home_active.png" alt="">
          <p class="active">发票采集</p>
        </li>
        <router-link to="/myInVoice">
          <li>
            <img src="../assets/images/book.png" alt="">
            <p>发票夹</p>
          </li>
        </router-link>
        <router-link to="/inVoiceCheck">
          <li>
            <img src="../assets/images/search.png" alt="">
            <p>发票查验</p>
          </li>
        </router-link>
        <router-link to="/myExpense">
          <li>
            <img src="../assets/images/money.png" alt="">
            <p>我要报销</p>
          </li>
        </router-link>
      </ul>
    </footer>
  </div>
</template>
<script>
import "../assets/css/swiper.min.css";
import "../../static/swiper.min.js";
export default {
    name: "index",
    components: {},
    data() {
        return {
            invType: 0,
            invCode: 0,
            invNum: 0,
            issueDate: 0,
            validCode: 0
        };
    },
    mounted() {
        var mySwiper = new Swiper(".swiper-container", {
            autoplay: 3000,
            direction: "horizontal",
            loop: true,
            pagination: ".swiper-pagination",
            nextButton: ".swiper-button-next",
            prevButton: ".swiper-button-prev"
        });
        window.result = this.result;
        //this.result(11);
    },
    methods: {
        result(id) {
            var info = [];
            info = id.split(",");
            // 普票
            if (info[1] == "04") {
                this.invType = 2;
            }
            //专票
            if (info[1] == "01") {
                this.invType = 1;
            }
            //电子发票
            if (info[1] == "10") {
                this.invType = 3;
            }
            //机动车发票
            if (info[1] == "03") {
                this.invType = 4;
            }
            //卷票
            if (info[1] == "11") {
                this.invType = 2;
            }
            this.$router.push({
                name: "inputInfo",
                params: {
                    invType: this.invType,
                    invCode: info[2],
                    invNum: info[3],
                    amount: info[4],
                    issueDate: info[5],
                    validCode: info[6]
                }
            });
            return 0;
        }
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.player img {
    width: 100%;
}

.box {
    height: 110px;
    border-bottom: 1px solid #ddd;
}

.box li {
    width: 33.3%;
    height: 110px;
    float: left;
    text-align: center;
}

.box li img {
    width: 46px;
    margin-top: 16px;
    margin-bottom: 6px;
}

.box li p {
    color: #56c0eb;
}
</style>
